import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/standing_book/operating_ledger_entity.dart';
import 'package:enterprise_v6_app/app/core/core.dart';

import 'package:enterprise_v6_app/app/data/entities/application/execute_entity.dart';


OperatingLedgerEntity $OperatingLedgerEntityFromJson(Map<String, dynamic> json) {
  final OperatingLedgerEntity operatingLedgerEntity = OperatingLedgerEntity();
  final String? applyUserName = jsonConvert.convert<String>(json['applyUserName']);
  if (applyUserName != null) {
    operatingLedgerEntity.applyUserName = applyUserName;
  }
  final String? departmentName = jsonConvert.convert<String>(json['departmentName']);
  if (departmentName != null) {
    operatingLedgerEntity.departmentName = departmentName;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    operatingLedgerEntity.id = id;
  }
  final double? identity = jsonConvert.convert<double>(json['identity']);
  if (identity != null) {
    operatingLedgerEntity.identity = identity;
  }
  final String? involvedWorkName = jsonConvert.convert<String>(json['involvedWorkName']);
  if (involvedWorkName != null) {
    operatingLedgerEntity.involvedWorkName = involvedWorkName;
  }
  final String? planEndDate = jsonConvert.convert<String>(json['planEndDate']);
  if (planEndDate != null) {
    operatingLedgerEntity.planEndDate = planEndDate;
  }
  final String? planStartDate = jsonConvert.convert<String>(json['planStartDate']);
  if (planStartDate != null) {
    operatingLedgerEntity.planStartDate = planStartDate;
  }
  final String? processTypes = jsonConvert.convert<String>(json['processTypes']);
  if (processTypes != null) {
    operatingLedgerEntity.processTypes = processTypes;
  }
  final List<OperatingLedgerReceiptLists>? receiptLists = (json['receiptLists'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<OperatingLedgerReceiptLists>(e) as OperatingLedgerReceiptLists).toList();
  if (receiptLists != null) {
    operatingLedgerEntity.receiptLists = receiptLists;
  }
  final String? ticketAddress = jsonConvert.convert<String>(json['ticketAddress']);
  if (ticketAddress != null) {
    operatingLedgerEntity.ticketAddress = ticketAddress;
  }
  final String? ticketContent = jsonConvert.convert<String>(json['ticketContent']);
  if (ticketContent != null) {
    operatingLedgerEntity.ticketContent = ticketContent;
  }
  final String? ticketName = jsonConvert.convert<String>(json['ticketName']);
  if (ticketName != null) {
    operatingLedgerEntity.ticketName = ticketName;
  }
  final String? ticketNo = jsonConvert.convert<String>(json['ticketNo']);
  if (ticketNo != null) {
    operatingLedgerEntity.ticketNo = ticketNo;
  }
  final String? ticketSource = jsonConvert.convert<String>(json['ticketSource']);
  if (ticketSource != null) {
    operatingLedgerEntity.ticketSource = ticketSource;
  }
  final RxBool? isShow = jsonConvert.convert<RxBool>(json['isShow']);
  if (isShow != null) {
    operatingLedgerEntity.isShow = isShow;
  }
  return operatingLedgerEntity;
}

Map<String, dynamic> $OperatingLedgerEntityToJson(OperatingLedgerEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['applyUserName'] = entity.applyUserName;
  data['departmentName'] = entity.departmentName;
  data['id'] = entity.id;
  data['identity'] = entity.identity;
  data['involvedWorkName'] = entity.involvedWorkName;
  data['planEndDate'] = entity.planEndDate;
  data['planStartDate'] = entity.planStartDate;
  data['processTypes'] = entity.processTypes;
  data['receiptLists'] = entity.receiptLists.map((v) => v.toJson()).toList();
  data['ticketAddress'] = entity.ticketAddress;
  data['ticketContent'] = entity.ticketContent;
  data['ticketName'] = entity.ticketName;
  data['ticketNo'] = entity.ticketNo;
  data['ticketSource'] = entity.ticketSource;
  data['isShow'] = entity.isShow?.toJson();
  return data;
}

extension OperatingLedgerEntityExtension on OperatingLedgerEntity {
  OperatingLedgerEntity copyWith({
    String? applyUserName,
    String? departmentName,
    String? id,
    double? identity,
    String? involvedWorkName,
    String? planEndDate,
    String? planStartDate,
    String? processTypes,
    List<OperatingLedgerReceiptLists>? receiptLists,
    String? ticketAddress,
    String? ticketContent,
    String? ticketName,
    String? ticketNo,
    String? ticketSource,
    RxBool? isShow,
  }) {
    return OperatingLedgerEntity()
      ..applyUserName = applyUserName ?? this.applyUserName
      ..departmentName = departmentName ?? this.departmentName
      ..id = id ?? this.id
      ..identity = identity ?? this.identity
      ..involvedWorkName = involvedWorkName ?? this.involvedWorkName
      ..planEndDate = planEndDate ?? this.planEndDate
      ..planStartDate = planStartDate ?? this.planStartDate
      ..processTypes = processTypes ?? this.processTypes
      ..receiptLists = receiptLists ?? this.receiptLists
      ..ticketAddress = ticketAddress ?? this.ticketAddress
      ..ticketContent = ticketContent ?? this.ticketContent
      ..ticketName = ticketName ?? this.ticketName
      ..ticketNo = ticketNo ?? this.ticketNo
      ..ticketSource = ticketSource ?? this.ticketSource
      ..isShow = isShow ?? this.isShow;
  }
}

OperatingLedgerReceiptLists $OperatingLedgerReceiptListsFromJson(Map<String, dynamic> json) {
  final OperatingLedgerReceiptLists operatingLedgerReceiptLists = OperatingLedgerReceiptLists();
  final List<int>? abnormalType = (json['abnormalType'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<int>(e) as int).toList();
  if (abnormalType != null) {
    operatingLedgerReceiptLists.abnormalType = abnormalType;
  }
  final String? applyUserId = jsonConvert.convert<String>(json['applyUserId']);
  if (applyUserId != null) {
    operatingLedgerReceiptLists.applyUserId = applyUserId;
  }
  final String? applyUserName = jsonConvert.convert<String>(json['applyUserName']);
  if (applyUserName != null) {
    operatingLedgerReceiptLists.applyUserName = applyUserName;
  }
  final String? endDate = jsonConvert.convert<String>(json['endDate']);
  if (endDate != null) {
    operatingLedgerReceiptLists.endDate = endDate;
  }
  final String? guardianUserId = jsonConvert.convert<String>(json['guardianUserId']);
  if (guardianUserId != null) {
    operatingLedgerReceiptLists.guardianUserId = guardianUserId;
  }
  final String? guardianUserName = jsonConvert.convert<String>(json['guardianUserName']);
  if (guardianUserName != null) {
    operatingLedgerReceiptLists.guardianUserName = guardianUserName;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    operatingLedgerReceiptLists.id = id;
  }
  final double? look = jsonConvert.convert<double>(json['look']);
  if (look != null) {
    operatingLedgerReceiptLists.look = look;
  }
  final String? otherTicketNo = jsonConvert.convert<String>(json['otherTicketNo']);
  if (otherTicketNo != null) {
    operatingLedgerReceiptLists.otherTicketNo = otherTicketNo;
  }
  final String? planEndDate = jsonConvert.convert<String>(json['planEndDate']);
  if (planEndDate != null) {
    operatingLedgerReceiptLists.planEndDate = planEndDate;
  }
  final String? planStartDate = jsonConvert.convert<String>(json['planStartDate']);
  if (planStartDate != null) {
    operatingLedgerReceiptLists.planStartDate = planStartDate;
  }
  final String? startDate = jsonConvert.convert<String>(json['startDate']);
  if (startDate != null) {
    operatingLedgerReceiptLists.startDate = startDate;
  }
  final String? ticketBigTypeName = jsonConvert.convert<String>(json['ticketBigTypeName']);
  if (ticketBigTypeName != null) {
    operatingLedgerReceiptLists.ticketBigTypeName = ticketBigTypeName;
  }
  final String? ticketNo = jsonConvert.convert<String>(json['ticketNo']);
  if (ticketNo != null) {
    operatingLedgerReceiptLists.ticketNo = ticketNo;
  }
  final String? ticketPlanId = jsonConvert.convert<String>(json['ticketPlanId']);
  if (ticketPlanId != null) {
    operatingLedgerReceiptLists.ticketPlanId = ticketPlanId;
  }
  final double? type = jsonConvert.convert<double>(json['type']);
  if (type != null) {
    operatingLedgerReceiptLists.type = type;
  }
  final String? receiptNo = jsonConvert.convert<String>(json['receiptNo']);
  if (receiptNo != null) {
    operatingLedgerReceiptLists.receiptNo = receiptNo;
  }
  final List<ExecuteTicketReceiptListOperatorLists>? guardianList = (json['guardianList'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<ExecuteTicketReceiptListOperatorLists>(e) as ExecuteTicketReceiptListOperatorLists).toList();
  if (guardianList != null) {
    operatingLedgerReceiptLists.guardianList = guardianList;
  }
  return operatingLedgerReceiptLists;
}

Map<String, dynamic> $OperatingLedgerReceiptListsToJson(OperatingLedgerReceiptLists entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['abnormalType'] = entity.abnormalType;
  data['applyUserId'] = entity.applyUserId;
  data['applyUserName'] = entity.applyUserName;
  data['endDate'] = entity.endDate;
  data['guardianUserId'] = entity.guardianUserId;
  data['guardianUserName'] = entity.guardianUserName;
  data['id'] = entity.id;
  data['look'] = entity.look;
  data['otherTicketNo'] = entity.otherTicketNo;
  data['planEndDate'] = entity.planEndDate;
  data['planStartDate'] = entity.planStartDate;
  data['startDate'] = entity.startDate;
  data['ticketBigTypeName'] = entity.ticketBigTypeName;
  data['ticketNo'] = entity.ticketNo;
  data['ticketPlanId'] = entity.ticketPlanId;
  data['type'] = entity.type;
  data['receiptNo'] = entity.receiptNo;
  data['guardianList'] = entity.guardianList?.map((v) => v.toJson()).toList();
  return data;
}

extension OperatingLedgerReceiptListsExtension on OperatingLedgerReceiptLists {
  OperatingLedgerReceiptLists copyWith({
    List<int>? abnormalType,
    String? applyUserId,
    String? applyUserName,
    String? endDate,
    String? guardianUserId,
    String? guardianUserName,
    String? id,
    double? look,
    String? otherTicketNo,
    String? planEndDate,
    String? planStartDate,
    String? startDate,
    String? ticketBigTypeName,
    String? ticketNo,
    String? ticketPlanId,
    double? type,
    String? receiptNo,
    List<ExecuteTicketReceiptListOperatorLists>? guardianList,
  }) {
    return OperatingLedgerReceiptLists()
      ..abnormalType = abnormalType ?? this.abnormalType
      ..applyUserId = applyUserId ?? this.applyUserId
      ..applyUserName = applyUserName ?? this.applyUserName
      ..endDate = endDate ?? this.endDate
      ..guardianUserId = guardianUserId ?? this.guardianUserId
      ..guardianUserName = guardianUserName ?? this.guardianUserName
      ..id = id ?? this.id
      ..look = look ?? this.look
      ..otherTicketNo = otherTicketNo ?? this.otherTicketNo
      ..planEndDate = planEndDate ?? this.planEndDate
      ..planStartDate = planStartDate ?? this.planStartDate
      ..startDate = startDate ?? this.startDate
      ..ticketBigTypeName = ticketBigTypeName ?? this.ticketBigTypeName
      ..ticketNo = ticketNo ?? this.ticketNo
      ..ticketPlanId = ticketPlanId ?? this.ticketPlanId
      ..type = type ?? this.type
      ..receiptNo = receiptNo ?? this.receiptNo
      ..guardianList = guardianList ?? this.guardianList;
  }
}
